home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 4 / Amiga Tools 4.iso / grafix / raytracing / raylab / scenes / 3balls.rl next >
Encoding:
Text File  |  1996-02-16  |  2.9 KB  |  211 lines

  1. ;------------------------------------------------------------------------
  2. ; This is an example scene of three hovering, strange balls and a pillar
  3. ; standing on a checkered ground.
  4. ;
  5. ; Author:          Marcus Geelnard
  6. ; Date:            5-Dec-1995
  7. ; RayLab version:  1.0
  8. ;------------------------------------------------------------------------
  9.  
  10.  
  11. Globals:
  12.     picwidth 640  picheight 480    * Set picture dimensions
  13.     recdepth 4
  14.     display 1
  15. ;    antialiasrec 2  antialiasthreshold 0.4    * Uncomment to enable
  16. ;                        * antialiasing
  17. :end
  18.  
  19.  
  20. #
  21. #  This texture will be used as default, if these values are not replaced
  22. #  by something else in the objects' declarations:
  23. #
  24.  
  25. deftexture:
  26.     reflect 0.6 0.6 0.6
  27.     phong 0.7
  28.     phongsize 20
  29.     diffuse 0.6
  30.     ambient 0.2
  31. :end
  32.  
  33. #
  34. #  Next come three good looking "balls" (they are a bit stretched)
  35. #
  36.  
  37. Sphere:
  38.     texture:
  39.         color 0.7 0.2 0.3
  40.     :end
  41.     transform:
  42.         scale 0.6 1.3 2
  43.         rotate 40 -32 0
  44.         move -4.5 5 2
  45.     :end
  46. :end
  47.  
  48. Sphere:
  49.     texture:
  50.         color 0.3 0.9 0.3
  51.     :end
  52.     transform:
  53.         scale 1.6 0.8 1.3
  54.         rotate -40 0 -70
  55.         move -2 4 1
  56.     :end
  57. :end
  58.  
  59. Sphere:
  60.     texture:
  61.         color 0.5 0.3 1.0
  62.     :end
  63.     transform:
  64.         scale 1.0 1.5 0.6
  65.         rotate 20 -40 0
  66.         move 0 3 3
  67.     :end
  68. :end
  69.  
  70.  
  71. #
  72. #  We need a ground aswell... It will be (surprise!) checkered.
  73. #
  74.  
  75. Plane:
  76.     offset -2
  77.     texture:
  78.         colormap 2
  79.             0.0  0.3 0.2 0.1
  80.             1.0  1.0 0.8 0.6
  81.         pattern checker
  82.         reflect 0.2 0.16 0.1
  83.         ambient 0.1
  84.         diffuse 0.7
  85.         phong 0.4
  86.         transform:
  87.             scale 5 4 3
  88.         :end
  89.     :end
  90. :end
  91.  
  92.  
  93. #
  94. # Here comes a texture that will be used for a pillar:
  95. #
  96.  
  97. deftexture:
  98.     pattern circles
  99.     colormap 4
  100.         0.0  0.9 0.9 0.9
  101.         0.6  0.96 0.94 0.94
  102.         0.75 1.0 1.0 0.9
  103.         1.0  0.9 0.9 0.9
  104.     reflect 0.1 0.1 0.1
  105.     transform:
  106.         scale 0.4 0.7 0.3
  107.     :end
  108. :end
  109.  
  110. deftransform:            * The pillar will be transformed...
  111.     move  -2 2 0
  112.     rotate 0 0 20
  113. :end
  114.  
  115. #
  116. #  This is the actual pillar:
  117. #
  118.  
  119. Box:
  120.     corners
  121.         -5 7 -1.5
  122.         -3 9 2
  123. :end
  124.  
  125. Box:
  126.     corners
  127.         -5.3 6.7 -2
  128.         -2.7 9.3 -1.5
  129. :end
  130.  
  131. Box:
  132.     corners
  133.         -5.3 6.7 2
  134.         -2.7 9.3 2.5
  135. :end
  136.  
  137. Ellipsoid:            * Let's make the pillar more interresting...
  138.     centre -4 7.1 0.25
  139.     radius  0.5 0.3 1.3
  140. :end
  141.  
  142. Ellipsoid:
  143.     centre -3.1 8 0.25
  144.     radius  0.3 0.5 1.3
  145. :end
  146.  
  147. Ellipsoid:
  148.     centre -4 8.9 0.25
  149.     radius  0.5 0.3 1.3
  150. :end
  151.  
  152. Ellipsoid:
  153.     centre -4.9 8 0.25
  154.     radius  0.3 0.5 1.3
  155. :end
  156.  
  157. deftransform:
  158.     none            * This prevents the rest of the scene from
  159. :end                * being transformed...
  160.  
  161.  
  162. #
  163. # This is the bright blue sky (actually a huge sphere)
  164. #
  165.  
  166. Sphere:
  167.     centre 0 0 0
  168.     radius   2000
  169.     texture:
  170.         default        * Use hardcoded defaults to begin with
  171.         pattern gradient
  172.         colormap 3
  173.             0.0  0.3 0.5 0.9
  174.             0.2  0.1 0.3 0.8
  175.             1.0  0.0 0.0 0.7
  176.         ambient 1.0
  177.         diffuse 0
  178.         phong   0
  179.         reflect 0 0 0
  180.         transform:
  181.             scale 1 1 2000
  182.         :end
  183.     :end
  184. :end
  185.  
  186.  
  187. #
  188. # Two light-sources enlightens the scene:
  189. #
  190.  
  191. Light:
  192.     location  10 -30 30
  193.     color 1 1 1
  194. :end
  195.  
  196. Light:
  197.     location  -26 15 40
  198.     color 1 0.5 0.6
  199. :end
  200.  
  201.  
  202. #
  203. # This is the camera:
  204. #
  205.  
  206. Camera:
  207.     location  2 -5 1
  208.     viewpoint -2 3 1.5
  209. :end
  210.  
  211.